package com.tm.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author huangp
 * @create 2023-04-09 14:37
 */
@Data
@TableName("orders")
public class OrderEntity {
    
           private Long id;// bigint(20) NOT NULL COMMENT '主键',
           private String number;// varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '订单号',
           private Integer status;// int(11) NOT NULL DEFAULT '1' COMMENT '订单状态 1待付款，2待派送，3已派送，4已完成，5已取消',
           @TableField("user_id")
           private Long userId;// bigint(20) NOT NULL COMMENT '下单用户',
           @TableField("address_book_id")
           private Long addressBookId;// bigint(20) NOT NULL COMMENT '地址id',
           @TableField("order_time")
           @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
           private Date orderTime;// datetime NOT NULL COMMENT '下单时间',
           @TableField("checkout_time")
           @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
           private Date checkoutTime;// datetime NOT NULL COMMENT '结账时间',
           @TableField("pay_method")
           private Integer payMethod;// int(11) NOT NULL DEFAULT '1' COMMENT '支付方式 1微信,2支付宝',
           private BigDecimal amount;// decimal(10,2) NOT NULL COMMENT '实收金额',
           private String remark;// varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
           private String phone;// varchar(255) COLLATE utf8_bin DEFAULT NULL,
           private String address;// varchar(255) COLLATE utf8_bin DEFAULT NULL,
           @TableField("user_name")
            private String userName;// varchar(255) COLLATE utf8_bin DEFAULT NULL,
           private String consignee;// varchar(255) COLLATE utf8_bin DEFAULT NULL,
}
